<template>
    <div class="flex flex-col h-full">
        <div class="h-[28px] mb-2.5"></div>

        <div class="video-loading">
            <div
                v-loading="true"
                class="w-full pb-[75%]"
                element-loading-text="正在生成中..."
            ></div>
        </div>

        <el-popover
            placement="bottom"
            effect="dark"
            trigger="hover"
            :width="300"
            :content="value.prompt"
        >
            <template #reference>
                <div class="text-tx-regular leading-tight line-clamp-2 h-[35px]">
                    {{ value.prompt }}
                </div>
            </template>
        </el-popover>

        <div class="flex items-center justify-between mt-3">
            <div class="text-sm text-tx-placeholder">
                {{ value.create_time }}
            </div>
            <div>
                <el-tag v-if="value.type === 'text2video'">文生视频</el-tag>
                <el-tag v-if="value.type === 'img2video'">图生视频</el-tag>
            </div>
        </div>

    </div>
</template>

<script lang="ts" setup>
withDefaults(
    defineProps<{
        value?: VideoRecordResponse;
    }>(),
    {
        value: {} as VideoRecordResponse | any
    }
)
</script>

<style lang="scss" scoped>
.video-loading {
    flex: 1;
    width: 100%;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    :deep(.el-loading-mask) {
        background-color: var(--el-bg-color-page) !important;
        border-radius: 12px;
    }

}
</style>
